﻿using UnityEngine.Rendering.Universal;

namespace Learning
{
    public class XRayFeature : ScriptableRendererFeature
    {
        public XRaySetting settings = new XRaySetting();

        private XRayDrawHiddenPass _drawHiddenPass;
        private XRayDrawNormalPass _drawNormalPass;
        
        public override void Create()
        {
            _drawHiddenPass = new XRayDrawHiddenPass(settings.drawHiddenMat);
            _drawNormalPass = new XRayDrawNormalPass();
        }

        public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
        {
            renderer.EnqueuePass(_drawHiddenPass);
            renderer.EnqueuePass(_drawNormalPass);
        }
    }
}
